function displayResponse(xmlHttpRequest, idPrefix) {
  var responseDiv = document.getElementById(idPrefix + "response");
  var readyState = xmlHttpRequest.readyState;
  if (readyState == 4) {
    responseDiv.innerHTML =
    "<pre>" +
    xmlHttpRequest.status + " " + xmlHttpRequest.statusText + "\n" +
    xmlHttpRequest.getAllResponseHeaders() + "\n" +
    "\n" +
    formatXmlResponse(xmlHttpRequest.responseText) +
    "</pre>";
  } else {
    responseDiv.innerHTML = "Loading... " + readyState + "/4";
  }
}

Responder = function(idPrefix) {
  this.idPrefix = idPrefix;
}

Responder.prototype.onresponse = function(xmlHttpRequest) {
  displayResponse(xmlHttpRequest, this.idPrefix);
}
